//
//  UIDefines.h
//  R_Renren
//
//  Created by Hao Zeng on 15/1/18.
//  Copyright (c) 2015年 Zeng Hao. All rights reserved.
//

#ifndef R_Renren_UIDefines_h
#define R_Renren_UIDefines_h

#define SCREEN_WIDTH [[UIScreen mainScreen] bounds].size.width
#define SCREEN_HEIGHT [[UIScreen mainScreen] bounds].size.height
#define USE_TES_ENV   0   //测试环境
#define USE_WWW_ENV   1   //正式上线的环境

#if USE_TES_ENV

#define PROJECT_URL  @"http://192.168.3.19:8080/swimQinghai/"//192.168.3.159:8080
#define PROJECT_URL_END  @"app.server"

#elif USE_WWW_ENV

#define PROJECT_URL  @"http://120.55.86.104:80/"
//http://115.28.80.194:80/
#define PROJECT_URL_END  @"app.server"
#endif


#define kWXAPP_ID @"wxd38ec0963793023c"
#define kQQAPP_ID @"1103770470" //1103770470kehu//100358052demo//1104785277mine//1104795332

#define WeiboAppKey @"2939243206"//2045436852
#define kRedirectURI    @"http://www.sina.com"

#define EmptyString(string) [string isEqualToString:@""]
//DES 加密
#define YQH_DESEncrypt_Key @"eVfcMiA=" //正式密钥
#define YQH_RELEASEMODEL @"swimQingHaiAPP="  //测试密钥
#define YQH_DESEncrypt_IV @{12,22,32,43,51,64,57,98} //随机向量

//限制输入类型
#define RestrictIDCard      @"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
#define RestrictKeyboardNum @"0123456789."
#define RestrictSpecialNum  @"@&$/"


#define CODE_KEY @"eVfcMiA="

#define CODE [dic[@"code"] integerValue]==0

#define H5_CODE [obj[@"result_code"] integerValue]==0

#define RestrictKeyboardNum @"0123456789."


#define  GET_X(element) ( element.frame.origin.x +element.frame.size.width)
#define  GET_Y(element) ( element.frame.origin.y +element.frame.size.height)

#define  GET_ONE_X(element) ( element.frame.origin.x)
#define  GET_ONE_Y(element) ( element.frame.origin.y)

#define SPACE 10
#define TopH 64
#define TabbarH 49
#define FooterH 50
#define HeaderH 50

#define FRAME_CG(X, Y, W, H) CGRectMake(X, Y, W, H)
#define FONT(R) [UIFont systemFontOfSize:R]

#define kInputTextViewMinHeight 36
#define kInputTextViewMaxHeight 200
#define kHorizontalPadding 8
#define kVerticalPadding 5

#define ButtonW (SCREEN_WIDTH-50)/4


#define  CLEAR_BACKGROUN_COLOR(element) element.backgroundColor = [UIColor clearColor]
#define UICOLOR_FOR_ONE(R) [UIColor colorWithRed:R/255.0 green:R/255.0 blue:R/255.0 alpha:1]//一种颜色
#define NAVIGATION_TEXT_COLOR [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:1] // 导航栏字体颜色


#define MINEBTN_WIDTH  ((SCREEN_WIDTH-2)/3)

#define IntegralSwitchProPortion 100 //积分兑换比例

//
#define NAVI_COLOR [UIColor colorWithRed:240.0/255.0 green:105.0/255.0 blue:131.0/255.0 alpha:1.0]
#define BG_COLOR [UIColor colorWithRed:223.0/255.0 green:223.0/255.0 blue:223.0/255.0 alpha:1.0]
#define COLOR(R,G,B) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:1.0]
#define COLOR_alpha(R,G,B,alp) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:alp]
#define ORANGE_COLOR [UIColor colorWithRed:250.0/255.0 green:121.0/255.0 blue:45.0/255.0 alpha:1.0]
#define BG_COL [UIColor colorWithRed:235.0/255.0 green:236.0/255.0 blue:237.0/255.0 alpha:1.0]
#define BULE_COL [UIColor colorWithRed:21.0/255.0 green:138.0/255.0 blue:232.0/255.0 alpha:1.0]
#define BG_Transparent [UIColor colorWithRed:40.0/255.0 green:41.0/255.0 blue:42.0/255.0 alpha:0.3]
#define DEFAULT_TEXT_BG_GRAY_COLOR204 [UIColor colorWithRed:204.0/255.0 green:204.0/255.0 blue:204.0/255.0 alpha:1]

#define Light_OrangeColor COLOR(250, 155, 10)
#define Light_GreenColor COLOR(93, 184, 18)

#define APP_TINT_COLOR [UIColor colorWithRed:255.0/255.0 green:176.0/255.0 blue:60.0/255.0 alpha:1] // 顶部的黄色

#define BACKGROUND_COLOR251 [UIColor colorWithRed:251.0/255.0 green:250.0/255.0 blue:245.0/255.0 alpha:1]; 

#define DEFAULT_TEXT_BG_GRAY_COLOR255 [UIColor colorWithRed:251.0/255.0 green:240.0/255.0 blue:240.0/255.0 alpha:1]
//注册不带object的通知
#define ADD_NIL_OBSERVER(action,actionName) [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(action) name:actionName object:nil]
////注册带object 的通知
 #define POST_NOTIFICATION(_name,_object)  [[NSNotificationCenter defaultCenter] postNotificationName:_name object:_object];
//注册不带object 的通知
#define POST_NOTIFICATION_NIL(_name,_object)  [[NSNotificationCenter defaultCenter] postNotificationName:_name object:nil];
//移除通知
#define REMOVE_OBSERVER [[NSNotificationCenter defaultCenter] removeObserver:self]

#define APPLICATION_ID   @"920007273"

#define DefaultIMG [UIImage imageNamed:@"lk_default"]

#define MAX_LEGNTH 20
#define MAX_PHONE_LEGNTH  11
#define MAX_PSW_LENGTH  18
#define MAX_VALICODE_LENGTH 6
#define MAX_NAME_LENGTH 4
#define MAX_CARNUM_LENGTH 5


#define height(h) (IMAGE_RATE_HEIGHT*h)

#define width(w) (IMAGE_RATE_WIDTH*w)

#define  Llongitude @"longitude"
#define  Llatitude  @"latitude"

#define PAGESIZE 10

#define RUserID @"R_USERID"
#define RName  @"R_USERNAME"
#define RPASSWORD   @"R_PASSWORD"

#define WXOPENID @"WX_OPENID"
#define QQOPENID @"QQ_OPENID"
#define QQHEADUrl   @"QQ_HEADUrl"

#define CODE_DEFAULT 81 //攀枝花

//登录时得到userID
#define GetRUserID [[NSUserDefaults standardUserDefaults] objectForKey:RUserID]
#define GetRUserName [[NSUserDefaults standardUserDefaults] objectForKey:RName]
#define GetRUserPASSWORD [[NSUserDefaults standardUserDefaults] objectForKey:RPASSWORD]

#define GetWXOPENID [[NSUserDefaults standardUserDefaults] objectForKey:WXOPENID]
#define GetQQOPENID [[NSUserDefaults standardUserDefaults] objectForKey:QQOPENID]

#define GetQQHEADUrl [[NSUserDefaults standardUserDefaults] objectForKey:QQHEADUrl]


#define PATH_OF_DOCUMENT    [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]

#endif
//typedef enum LoadDatasourceStatus{
//    LoadDatasourceStatusNone = 0, //正常数据
//    LoadDatasourceStatusIng,    //正在加载
//    LoadDatasourceStatusNoResult, //数据为空
//    LoadDatasourceStatusMore,//正在加载下一页
//    LoadDatasourceStatusNoNextPage //没有更多数据,不需要加载下一页
//}LoadDatasourceStatus;
//

typedef void (^VoidBlock)(void) ;




